package com.seari.vehbaseP.service.impl;

import com.seari.vehbaseP.bean.CommonPartResponse;
import com.seari.vehbaseP.bean.DeviceInfo;
import com.seari.vehbaseP.mapper.DeviceInfoMapper;
import com.seari.vehbaseP.service.DeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("DeviceInfoService")
public class DeviceInfoServiceimpl implements DeviceInfoService {

    @Autowired
    DeviceInfoMapper deviceInfoMapper;

    @Override
    public void addDeviceInfoList(List<DeviceInfo> deviceInfoBeans) {
        deviceInfoMapper.addDeviceInfoList(deviceInfoBeans);
    }

    @Override
    public CommonPartResponse seachDeviceInfo(String ProjectCode) {

        List<DeviceInfo> deviceInfos = deviceInfoMapper.seachDeviceInfo(ProjectCode);
        return CommonPartResponse.success("success",deviceInfos);

    }

    @Override
    public CommonPartResponse seachDeviceInfoBySystem(String ProjectCode, String SystemCode) {
        List<DeviceInfo> deviceInfos = deviceInfoMapper.seachDeviceInfoBySystem(ProjectCode, SystemCode);
        return CommonPartResponse.success("success",deviceInfos);
    }
}